home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48_1
/
ipdldemo.exe
/
lha
/
LOOKUP.APP
< prev
next >
Wrap
Text File
|
1991-02-27
|
2KB
|
57 lines
// HP 48 Program Development Link Application
//
/Angle Degrees
/FractionMark .
/InstallDir
/AutoExec
//
/Var DataList
@ Order of data is:
@ { "Name" "Occupation" "Company" }
{
{ "HOLLY WOOD" "Starlet" "Twinkle Twinkle Productions" }
{ "G.O. THERMAL" "Energy Consultant" "Esteamed Enterprises" }
{ "RICH FOODZ" "Dietitian" "Waist Away" }
{ "CLAIRE VOYANT" "Financial Advisor" "Sellum and Howe" }
{ "ADAM SPLITTER" "Scientist" "Con-Fusion Research" }
}
//
/Var GetCo
@ { "Name" \-> "Company" }
\<<
'DataList' SWAP 1 3 GetData @ get the company name
\>>
//
/Var GetData
@ { {List} "ToFind" Field ItemNum \-> "Item" }
\<<
\-> list tofind field itemnum @ save the arguments
\<<
0 @ initialize the success flag
1 list RCL SIZE
FOR i @ for each element in the list...
list i GET @ get the element
IF
DUP field GET tofind SAME @ if it matches the specified field...
THEN
itemnum GET @ ...then get the desired item...
SWAP DROP 1 @ ...signal success...
9E499 'i' STO @ ...and quit searching
ELSE
DROP
END
NEXT
IF
NOT @ if the item wasn't found...
THEN
tofind " Not Found" + @ ...then signal not found
END
\>>
\>>
//
/Var GetOcc
@ { "Name" \-> "Occupation" }
\<<
'DataList' SWAP 1 2 GetData @ get the occupation
\>>